package com.liss.concurrency;

/**
 * @author lisensen
 * @date 2024/9/12
 */
public class _4_05Daemon {
    public static void main(String[] args) {
        Thread thread = new Thread(new DaemonRunner(), "DaemonRunner");
        thread.setDaemon(true);
        thread.start();
    }
    static class DaemonRunner implements Runnable {
        @Override
        public void run() {
            System.out.println("run");
            try {
                System.out.println("try");
                _4_04SleepUtils.second(10);
                System.out.println("sleep over");
            } finally {
                System.out.println("DaemonThread finally run.");
            }
        }
    }
}
